function checkIsLogin() {
	var login = false;
	Ext.Ajax.request({
		url : '/ajaxCheckIsLogin.action',
		async : false,
		success : function(result, request) {
			if (result.responseText === 'false') {
				document.location = "login.jsp";
			}
		},
		failure : function(result, request) {

		}
	});
	return login;
}
checkIsLogin();
Ext.Loader.setPath('Ext.ux','/ext4/ux');
Ext.application({
	name : 'Usws',
	controllers : [ 'Launch', 'SysUser', 'Channel', 'Meeting', 'Video',
			'VideoComment', 'VideoFile', 'BaseDict', 'BaseVideoCat', 'Clz',
			'MeetingAttendee','VideoAttendee','VideoExtattr','BaseVideoTypeExtattr',
			'School', 'UserAttr','VideoAuthLog','VideoPlayLog','VideoType'
	],
	autoCreateViewport : true
});

function showMessage(title, msg, buttons, buttonTextModel, callBack) {
	var me = Ext.create('Usws.model.ButtonText', {
        ok: '确定',
        yes: '是', 
        no:'否',
        cancel:'取消'
    }); 
	if(buttonTextModel) {
		var ok = buttonTextModel.get("ok");
		if(ok) {
			me.set("ok", ok);
		}
		var yes = buttonTextModel.get("yes");
		if(yes) {
			me.set("yes", yes);
		}
		var no = buttonTextModel.get("no");
		if(no) {
			me.set("no", buttonTextModel.get("no"));
		}
		if(buttonTextModel.cancel) {
			me.set("cancel", buttonTextModel.get("cancel"));
		}
	}
	
	var buttonText;
	if(buttons === Ext.MessageBox.YESNO) {
		buttonText = {
				yes: me.get("yes"), 
				no: me.get("no")	
		};
	} else if(buttons === Ext.MessageBox.YESNOCANCEL) {
		buttonText = {
				yes: me.get("yes"), 
				no: me.get("no"), 
				cancel: me.get("cancel")
		};
	} else if(buttons === Ext.MessageBox.YES) {
		buttonText = {
				yes: me.get("yes")
		};
	} else if(buttons === Ext.MessageBox.NO) {
		buttonText = {
				no: me.get("no")
		};
	} else if(buttons === Ext.MessageBox.OKCANCEL) {
		buttonText = {
				ok: me.get("ok"),
				cancel: me.get("cancel")
		};
	} else if(buttons === Ext.MessageBox.OK) {
		buttonText = {
				ok: me.get("ok")
		};
	} else if(buttons === Ext.MessageBox.CANCEL) {
		buttonText = {
				cancel: me.get("cancel")
		};
	} 

	Ext.MessageBox.show({
			        title: title,
			        msg: msg,
			        buttons: buttons,
			        buttonText:buttonText,
			        fn: callBack
    });
}